﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LibFriesland_Campina_CRM
{
    public class BizShop
    {
        #region Thuoc tinh
        public string shop_charid { get; set; }
        public string name { get; set; }
        public string address { get; set; }
        public double latitude { get; set; }
        public double longitude { get; set; }
        public string by_sup { get; set; }
        #endregion

        #region Ham thiet lap
        public BizShop() { }
        public BizShop(string pShop_charid, string pName)
        {
            shop_charid = pShop_charid;
            name = pName;
        }

        public BizShop(string pShop_charid, string pName, string pBy_sup)
        {
            shop_charid = pShop_charid;
            name = pName;
            by_sup = pBy_sup;
        }

        public BizShop(string pShop_charid, string pName, string pAddress, double pLatitude, double pLongitude)
        {
            shop_charid = pShop_charid;
            name = pName;
            address = pAddress;
            latitude = pLatitude;
            longitude = pLongitude;
        }
        #endregion

        #region Phuong thuc
        //Lay Shop theo ID
        public static BizShop getShopbyID(string pShop_charid)
        {
            return DalShop.getShopbyID(pShop_charid);
        }
        #endregion
    }

    public class ShopSort : IComparable<BizShop>
    {
        public int CompareTo(BizShop other) { return 1; }
        public static Comparison<BizShop> shopCharIDComparison = delegate(BizShop p1, BizShop p2)
        {
            return p1.shop_charid.CompareTo(p2.shop_charid);
        };
    }
}
